# %%
import torch
from torch import nn, Tensor, optim
from torch.autograd import Variable
from typing import (
    TypeVar, Type, Union, Optional, Any,
    List, Dict, Tuple, Callable, NamedTuple
)

import numpy as np

import random
import time
import os
import copy
import re
import logging
from concurrent.futures import ThreadPoolExecutor
from concurrent import futures
import itertools

from utils import Args, D, timeit

logger = logging.getLogger(__name__)
logging.basicConfig(
    level=10, format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s')

a = [(1.4, 2), (3, 4), (5, 6)]
b = 4
_a = Tensor(a).t()
_b = Tensor(b)
_c = copy.deepcopy(_a)
_m = torch.stack((_a, _c))
print(_m)
# print(torch.stack((1,2,3,4)))

x = Tensor([1, 2])
print(torch.unsqueeze(x, 0))
print(torch.unsqueeze(x, 1))
# print(torch.unsqueeze(x, 1))

y = Tensor([
    [1,2,3,4,5],
    [6,7,8,9,10]
])

import torch.nn.functional as F
L=10
Y=F.pad(y,(0,L-y.shape[1]),"constant",value=0)
print(Y)